<template>
    <div class="editor-header">
        <div class="super-editor-button-box" @click="handleClick" v-show="buttonShow">
            <el-icon>
                <ArrowRightBold />
            </el-icon>
        </div>
        <div class="super-editor-title">{{ title }}</div>
    </div>
    <DataTable :dataset="currentDatasetId" :subscribe="currentSubscribeId" :configure="true" />
</template>
<script setup>
import { ref,inject } from 'vue';
import DataTable from './DataTable.vue';
import { emitter } from '@/global.js'
const buttonShow = ref(true)
const title = ref('配置')

const userAction = inject('userAction')
const handleClick = () => {
    userAction('dataset')
}

const currentSubscribeId = ref(0)
const currentDatasetId = ref(0)
emitter.on('addConfig',(subscribe)=>{
    currentDatasetId.value = subscribe.dataset.id
    currentSubscribeId.value = subscribe.id
})

</script>

<style lang="scss" scoped>
.editor-header {
    height: var(--supereditor-header-height);
    line-height: var(--supereditor-header-height);
    display: flex;
    align-items: center;
    padding-left: 5px;
    gap: 10px;
    font-size: large;
    font-weight: bold;
    border-bottom: 1px solid #eee;
}
.super-editor-title {
    padding-left: 5px;
}
</style>